//
//  GYBuyDetailMiddleCell.m
//  GYDemo
//
//  Created by Mrzhang on 2018/4/8.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "GYBuyDetailMiddleCell.h"
#import "Head.h"

@interface GYBuyDetailMiddleCell ()
@property(nonatomic,strong)UILabel* markLab;
@property(nonatomic,strong)UILabel* titleLab;
@property(nonatomic,strong)UILabel* nameLab;
@property(nonatomic,strong)UILabel* linkLab;
@property(nonatomic,strong)UIImageView* markIV;
@end

@implementation GYBuyDetailMiddleCell
-(UILabel *)markLab
{
    if (!_markLab) {
        _markLab=[[UILabel alloc]initWithFrame:WFCGRectMake(12.5, 19.5, 5, 15)];
        _markLab.backgroundColor=Main_Color_Red;
    }
    return _markLab;
}

-(UILabel *)titleLab
{
    if (!_titleLab) {
        _titleLab=[[UILabel alloc] init];
        _titleLab.textColor=Main_Color_Black;
        _titleLab.font=SYSTEMFONT(15);
        _titleLab.frame=WFCGRectMake(28, 16.5, 200, 21);
        _titleLab.text=@"联系方式";
        
    }
    return _titleLab;
}
-(UILabel *)nameLab
{
    if (!_nameLab) {
        _nameLab=[[UILabel alloc] init];
        _nameLab.textColor=Main_Color_Black;
        _nameLab.font=SYSTEMFONT(15);
        _nameLab.frame=WFCGRectMake(12.5, 52.5, 375-25, 20);
        
    }
    return _nameLab;
}
-(UIImageView *)markIV
{
    if (!_markIV) {
        _markIV=[[UIImageView alloc] init];
        UIImage* image=[UIImage imageNamed:@"ren"];
        _markIV.frame=WFCGRectMake( 12.5,88.5,image.size.width, image.size.height);
        _markIV.image=image;
    }
    return _markIV;
}

-(UILabel *)linkLab
{
    if (!_linkLab) {
        _linkLab=[[UILabel alloc] init];
        _linkLab.textColor=Main_Color_Gray;
        _linkLab.font=SYSTEMFONT(12);
        _linkLab.frame=WFCGRectMake(35, 87, 375-55, 16.5);
        
    }
    return _linkLab;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.markIV];
        [self.contentView addSubview:self.markLab];
        [self.contentView addSubview:self.nameLab];
        [self.contentView addSubview:self.linkLab];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _nameLab.text=_model.companyname;
    if ([[GYLoginViewModel shareInterface] loginstatus]&&[[GYLoginViewModel shareInterface] roleType]==1)
    {
        
        _linkLab.text=[NSString stringWithFormat:@"%@ 电话:%@  QQ:%@",[WFFunctions WFCheckEmptyBackStr:_model.lname],@"400-800-9887",[GYLoginViewModel shareInterface].loginInfoModel.storeid];
    }else
    {
        _linkLab.text=[NSString stringWithFormat:@"%@ 电话:%@  QQ:%@",@"***",@"***",@"***  登录并认证会员后可见"];
    }
    
    
}
@end
